
{include file="users/header" /}

{if empty($list)}
<div>
    <img style="width: 300px;height: 300px;" src="/static/image/anli/暂无内容.png" alt="">
    <div class="botx4None">暂无内容～</div>
</div>
{else}
<div class="box4s">
    {foreach $list as $k=>$v}
    <div class="newlist">
        <div class="new">
            <div class="newimg">
                {if $v.pid ==0}
                {if $user.avatar}
                <svg  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="30" viewBox="0 0 24 24" fill="none">
                    <path d="M12 15C15.3137 15 18 12.3137 18 9C18 5.68629 15.3137 3 12 3C8.68629 3 6 5.68629 6 9C6 12.3137 8.68629 15 12 15Z" stroke="rgba(0, 0, 0, 1)" stroke-width="1" stroke-linejoin="round" stroke-linecap="round" style="mix-blend-mode:normal">
                    </path>
                    <path    stroke="rgba(0, 0, 0, 1)" stroke-width="1" stroke-linejoin="round" stroke-linecap="round" style="mix-blend-mode:normal" d="M3 22C5.11278 19.5614 8.35931 18 12 18C15.6407 18 18.8872 19.5614 21 22">
                    </path>
                </svg>
            </svg>
                {else}
                <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="22.16796875" height="22.16650390625" viewBox="0 0 22.16796875 22.16650390625" fill="none">
                    <g opacity="0.2">
                        <path d="M0.00217195 21.7181C0.00217195 21.9658 0.208876 22.1666 0.463874 22.1666L21.7013 22.1667C21.9563 22.1667 22.1631 21.9659 22.1631 21.7183L22.1631 21.1826C22.1737 21.0212 22.1953 20.2157 21.6643 19.3252C21.3295 18.7637 20.8436 18.2786 20.22 17.8834C19.4656 17.4054 18.506 17.059 17.3452 16.8505C17.3367 16.8493 16.476 16.7353 15.5943 16.5101C14.0589 16.1179 13.9247 15.7708 13.9238 15.7674C13.9148 15.7331 13.9017 15.7002 13.885 15.6692C13.8724 15.6045 13.8414 15.3608 13.9007 14.7079C14.0513 13.0497 14.9408 12.0697 15.6555 11.2824C15.8809 11.034 16.0938 10.7995 16.2577 10.5695C16.9649 9.57722 17.0305 8.44894 17.0335 8.379C17.0335 8.23731 17.0172 8.12082 16.9824 8.01284C16.913 7.79677 16.7824 7.66214 16.687 7.56385L16.6864 7.56315C16.6623 7.53842 16.6396 7.51497 16.6211 7.49344C16.614 7.48522 16.5953 7.46346 16.6123 7.35175C16.6751 6.94056 16.7128 6.59627 16.7309 6.26827C16.7631 5.68388 16.7882 4.80993 16.6375 3.95937C16.6189 3.81412 16.5869 3.66071 16.5372 3.47795C16.3779 2.89225 16.1221 2.3915 15.7666 1.97822C15.7054 1.91171 14.2191 0.345799 9.9043 0.0245049C9.30767 -0.0199159 8.71786 0.00401268 8.13727 0.0336868C7.99733 0.0406052 7.8057 0.0501018 7.62639 0.0965643C7.18089 0.211965 7.06201 0.494333 7.0308 0.652364C6.97906 0.914129 7.07 1.11775 7.13014 1.25252C7.13889 1.27206 7.14969 1.29624 7.13084 1.35915C7.03069 1.51426 6.87313 1.6541 6.71248 1.78659C6.66604 1.82605 5.58408 2.75898 5.52458 3.97769C5.36416 4.90455 5.37629 6.34865 5.56599 7.34673C5.57702 7.40186 5.59329 7.48347 5.56687 7.53859C5.36288 7.72141 5.13164 7.92861 5.13223 8.4014C5.13468 8.44894 5.2003 9.57722 5.90754 10.5695C6.07134 10.7993 6.28402 11.0337 6.50924 11.2818L6.50977 11.2824C7.22447 12.0697 8.11388 13.0497 8.26455 14.7079C8.32382 15.3607 8.29279 15.6045 8.28024 15.6692C8.2635 15.7001 8.25044 15.7331 8.24145 15.7674C8.24052 15.7708 8.10682 16.1167 6.57837 16.5081C5.6966 16.7339 4.82854 16.8493 4.80264 16.853C3.67465 17.0434 2.72089 17.3812 1.96788 17.8567C1.34641 18.2492 0.859567 18.7352 0.520855 19.3012C-0.0203155 20.2054 -0.00568555 21.029 0.00217195 21.1793L0.00217195 21.7181Z"  style="mix-blend-mode:normal" fill="#2D4761" >
                        </path>
                    </g>
                </svg>
                {/if}
                {else}
                <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="28" height="28" viewBox="0 0 28 28" fill="none">
                    <path    style="mix-blend-mode:normal" fill="#333333"  d="M21 18.6668C23.5773 18.6668 25.6667 16.5775 25.6667 14.0002C25.6667 11.4228 23.5773 9.3335 21 9.3335">
                    </path>
                    <path   fill="rgba(51, 51, 51, 1)" style="mix-blend-mode:normal" d="M21 18.0835C23.2552 18.0835 25.0833 16.2553 25.0833 14.0002C25.0833 11.745 23.2552 9.91683 21 9.91683L21 8.75016C23.8995 8.75016 26.25 11.1007 26.25 14.0002C26.25 16.8997 23.8995 19.2502 21 19.2502L21 18.0835Z">
                    </path>
                    <path    style="mix-blend-mode:normal" fill="#333333"  d="M6.9987 9.3335C4.42137 9.3335 2.33203 11.4228 2.33203 14.0002C2.33203 16.5775 4.42137 18.6668 6.9987 18.6668">
                    </path>
                    <path   fill="rgba(51, 51, 51, 1)" style="mix-blend-mode:normal" d="M6.9987 9.91683C4.74354 9.91683 2.91536 11.745 2.91536 14.0002C2.91536 16.2553 4.74354 18.0835 6.9987 18.0835L6.9987 19.2502C4.0992 19.2502 1.7487 16.8997 1.7487 14.0002C1.7487 11.1007 4.0992 8.75016 6.9987 8.75016L6.9987 9.91683Z">
                    </path>
                    <path    stroke="rgba(51, 51, 51, 1)" stroke-width="2" stroke-linejoin="round" stroke-linecap="round" style="mix-blend-mode:normal" d="M7 18.6668L7 18.3752L7 16.9168L7 14.0002L7 9.3335C7 5.4675 10.134 2.3335 14 2.3335C17.866 2.3335 21 5.4675 21 9.3335L21 18.6668C21 22.5328 17.866 25.6668 14 25.6668">
                    </path>
                </svg>



                {/if}
            </div>
            <div class="newname">
                <div class="newnameText">
                    {if $v.pid ==0}
                    {$user.nickname}
                    {else}
                    客服回复
                    {/if}
                </div>
                <div class="newtime"> {$v.createtime|date='Y-m-d H:i:s',###}</div>
            </div>


            {if $v.yddata=='0'}
            <div class="newread">
                未读
            </div>
            {/if}
            {if $v.yddata=='1'}
            <div class="read">
                已读
            </div>
            {/if}




            <div class="newdelete" onclick="delMsg('{$v.id}')">
                <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24" fill="none">
                    <path d="M4.5 5L4.5 22L19.5 22L19.5 5L4.5 5Z" stroke="rgba(51, 51, 51, 1)" stroke-width="1" stroke-linejoin="round"  style="mix-blend-mode:normal">
                    </path>
                    <path    stroke="rgba(51, 51, 51, 1)" stroke-width="1" stroke-linejoin="round" stroke-linecap="round" style="mix-blend-mode:normal" d="M10 10L10 16.5">
                    </path>
                    <path    stroke="rgba(51, 51, 51, 1)" stroke-width="1" stroke-linejoin="round" stroke-linecap="round" style="mix-blend-mode:normal" d="M14 10L14 16.5">
                    </path>
                    <path    stroke="rgba(51, 51, 51, 1)" stroke-width="1" stroke-linejoin="round" stroke-linecap="round" style="mix-blend-mode:normal" d="M2 5L22 5">
                    </path>
                    <path d="M8 5L9.6445 2L14.3885 2L16 5L8 5Z" stroke="rgba(51, 51, 51, 1)" stroke-width="1" stroke-linejoin="round"  style="mix-blend-mode:normal">
                    </path>
                </svg>

            </div>
        </div>
        <div class="newBottom">
            {:htmlspecialchars_decode($v.content)}
        </div>
    </div>

    {/foreach}

</div>

{/if}
</div>

<script>
    function delMsg(id){
        layer.confirm('是否确认删除？', {
            btn: ['确认', '取消'] //可以无限个按钮

        }, function(index, layero){
            $.post('{:url("users/delMsg")}',{id:id},function (res){
                if (res.code == 1) {
                    layer.msg(res.msg,{time: 2000,}, function () {
                        layer.closeAll();//疯狂模式，关闭所有层
                        location.href=res.url;
                    })
                } else {
                    layer.msg(res.msg);
                    return;
                }

            },'json')
        }, function(index){
            layer.closeAll();
        });

    }
</script>
